package com.starry.compose_study.compositionlocal

class ImplicitTest {
    var color: String = "黑色"

    fun Layout() {
        Text()
        provider("红色",color){
            Grid()
        }
        Text()
    }


    fun provider(value:String,perValue: String,content:(()->Unit)){
        color=value
        content()
        color=perValue
    }

    private fun Grid() {
        println("other components in Grid")
        Text()
    }

    private fun Text() {
        println(color)
    }
}

fun main() {
    val ip = ImplicitTest()
    ip.Layout()
}